# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=perl-json-webtoken
_pkgreal=JSON-WebToken
pkgver=0.10
pkgrel=5
pkgdesc="JSON Web Token (JWT) implementation for Perl"
url="https://github.com/xaicron/p5-JSON-WebToken"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-json perl-module-runtime perl-mime-base64 perl-carp"
makedepends="
	perl-module-build perl-test-requires perl-crypt-openssl-rsa perl-crypt-openssl-bignum
	perl-test-mock-guard perl-class-load
	"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/X/XA/XAICRON/JSON-WebToken-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	perl Build.PL --installdirs=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	./Build
}

check() {
	./Build test
}

package() {
	./Build install --destdir="$pkgdir"
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="ce4acd42814db12fc16c60a8937a4e7d420b0243c3ca26f96a36ee2a2fb4a14f93538340b199fcce9cfbb090d60de5d7e24d5f008a84e1365d7c31f6db9ee312  JSON-WebToken-0.10.tar.gz"
